//
//  UIColor+YSExtension.h
//  YSKitDemo
//
//  Created by MOLBASE on 2018/8/9.
//  Copyright © 2018年 YangShen. All rights reserved.
//

#import <UIKit/UIKit.h>

#define YSHexColor(hex) [UIColor ys_colorFromHexString:hex]

@interface UIColor (YSExtension)

/**
 获得随机颜色
 */
+ (instancetype)ys_randomColor;

/**
 获得带alpha随机颜色
 */
+ (instancetype)ys_randomColorWithAlpha:(CGFloat)alpha;

+ (instancetype)ys_colorWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue;

+ (instancetype)ys_colorWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha;

/**
 通过hex获得颜色
 */
+ (instancetype)ys_colorFromHexString:(NSString *)hex;

/**
 通过hex和alpha获得颜色
 */
+ (instancetype)ys_colorFromHexString:(NSString *)hex alpha:(CGFloat)alpha;

/**
 获取颜色的RGB数组
 */
- (NSArray<NSNumber *> *)getRGBComponents;

@end
